#pragma once

#ifndef __BENCH_TIMER_H__
#define __BENCH_TIMER_H__

#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif


namespace Tool
{
    // Results of some quick research on timing in Win32
    // http://www.geisswerks.com/ryan/FAQS/timing.html 

	//..............
    // benchmarking
	//..............

	class Bench
	{
		bool          m_verbose;

#ifdef _WIN32
		LARGE_INTEGER m_start;
		LARGE_INTEGER m_stop;
#else
        Uint32        m_start;
		Uint32        m_stop;
#endif

	public:
		Bench(bool p_verbose = false);
		~Bench();

		void start();
        void stop();
		double elapsedTime() const; // in seconds
	};


	//.............
	// timer event
	//.............

	// check ACE and Boost for timer implementations

	class Timer
	{
	public:
        void setTimeOutEvent(long p_event);
		void setTimeOutValue(long p_timeOut);
		void setTimeOutCb( void (*p_timeOutCb)(long) );
		void start();
		void kill();
	};

};

#endif // __BENCH_TIMER_H__
